using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using RpgXna.Model.Entities.MainCharacter;
using RpgXna.Model.XnaClassesWrappers;

namespace RpgXna.Model
{
    public class Scene
    {
        private readonly Character _c;

        private readonly EnvironmentRepository _env;

        private SpriteFont _font;

        public Scene(Character c, EnvironmentRepository env)
        {
            _c = c;
            _env = env;
        }

        public void Draw(SpriteBatch sb)
        {
            _c.Draw(sb);

            _env.Draw(sb);
        }

        public void LoadScene(ContentManager cm)
        {
            _c.Load(cm);

            _env.Load(cm);

            _font = cm.Load<SpriteFont>("Arial14");
        }

        public void Update(GameTime gt, MouseState mState, IKeyboardStateWrapper kbState)
        {
            _env.Update(gt, mState, kbState);

            _c.Update(gt, kbState);

            _env.CheckCharacterCollisions(_c, gt, mState, kbState);
        }
    }
}